#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void JS(int n)
{
	int i = 1;
	while (i < 32)
	{
		printf("%d", (n >> (32-i) & 1));
		i += 2;
	}
}
void OS(int n)
{
	int i = 2;
	while (i <= 32)
	{
		printf("%d", (n >> (32-i) & 1));
		i += 2;
	}
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	JS(n);
	printf("\n");
	OS(n);
	return 0;
}